/*
 *	根据用户给定的年月计算出当月所包含的天数并打印在屏幕上
 */

#include<stdio.h>

int main () {
	printf("输入年月:");
	int year = 0, month = 0;
	scanf("%d%d", &year, &month);
	if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
		printf("%d年%d月有%d天\n", year, month, 31);
	}
	else if (month == 4 || month == 6 || month == 9 || month == 11) {
		printf("%d年%d月有%d天\n", year, month, 30);
	}
	else if (month == 2) {
		if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
			printf("%d年%d月有%d天\n", year, month, 29);
		}
		else {
			printf("%d年%d月有%d天\n", year, month, 28);
		}
	}
	else {
		printf("不存在%d月\n", month);
	}
	return 0;
}
